package com.comprehensive.personalnovel.feign;

import com.comprehensive.common.dto.FolderFlieInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "personal-file-service")
public interface FileServiceFeignClient {
    @GetMapping("/file/list")
    ResponseEntity<List<FolderFlieInfo>> listFiles(@RequestParam("directoryPath") String directoryPath);

    @GetMapping("/file/stream")
    ResponseEntity<byte[]> streamFile(@RequestParam("filePath") String filePath);
    @GetMapping("/file/markdown/content")
    ResponseEntity<String> getMarkdownContent(@RequestParam String filePath);
    @PostMapping("/file/markdown/save")
    ResponseEntity<Void> saveMarkdownContent(@RequestParam String filePath, @RequestBody String content);
}
